//
//  File.swift
//
//
//  Created by didi on 2022/9/13.
//

public struct MolecularModelName {
    private var pluralException: String?

    public let singular: String
    public var plural: String { pluralException ?? singular + "s" }

    public init(singular: String, plural exception: String? = nil) {
        self.singular = singular.lowercased().capitalized
        pluralException = exception?.lowercased().capitalized
    }
}

extension MolecularModelName: ExpressibleByStringLiteral {
    public init(stringLiteral value: StringLiteralType) {
        self.init(singular: value)
    }
}
